package com.test.model;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 网路设备
 * @author zxw
 * create 2016年3月2日 下午6:54:55
 */

@Entity
@Table(name="rcc_e_netEqu")
public class NetEqu implements Serializable{
   private Integer uniqueId;
   private String serialNo;//编号
   private String phoneNumber;//手机号码
   private String detailPosition;//详细位置
   private Date installDate;//安装日期
//   private E_service service;//所属通讯服务
//   private InHousing inHousing;//所属小区
   private Model model;//型号
   private String memo;//备注
   private Station station;//换热站
   private String equState;
//   private Dictionary equProblem;
//   private E_service webSocketService;
//   private Set<NetEquCurrentAlarm> netEquCurrentAlarm;
//   private Set<NetEquCurrentFault> netEquCurrentFault;

   @Id
   @GeneratedValue
   @Column(name = "uniqueId", unique = true, nullable = false)
   public Integer getUniqueId() {
       return uniqueId;
   }

   @Column(name = "serialNo",  nullable = false)
   public String getSerialNo() {
       return serialNo;
   }
   @Column(name = "detailPosition")
   public String getDetailPosition() {
       return detailPosition;
   }
   @Column(name = "installDate")
   public Date getInstallDate() {
       return installDate;
   }
//   @ManyToOne(fetch = FetchType.LAZY)
//   @JoinColumn(name = "serviceId",nullable = false)
//   public E_service getService() {
//       return service;
//   }
//   @ManyToOne(fetch = FetchType.LAZY)
//   @JoinColumn(name = "inHousingId")
//   public InHousing getInHousing() {
//       return inHousing;
//   }
   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "modelId",nullable = false)
   public Model getModel() {
       return model;
   }
   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "stationId",nullable = false)
   public Station getStation() {
       return station;
   }
   @Column(name="memo")
   public String getMemo() {
       return memo;
   }
    @Column(name="phoneNumber")
    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public void setStation(Station station) {
       this.station = station;
   }

   public void setMemo(String memo) {
       this.memo = memo;
   }
   public void setModel(Model model) {
       this.model = model;
   }
   public void setUniqueId(Integer uniqueId) {
       this.uniqueId = uniqueId;
   }
   public void setSerialNo(String serialNo) {
       this.serialNo = serialNo;
   }
   public void setDetailPosition(String detailPosition) {
       this.detailPosition = detailPosition;
   }
   public void setInstallDate(Date installDate) {
       this.installDate = installDate;
   }
//   public void setService(E_service service) {
//       this.service = service;
//   }
//   public void setInHousing(InHousing inHousing) {
//       this.inHousing = inHousing;
//   }
//
//   @OneToMany(mappedBy = "netEqu")
//   public Set<NetEquCurrentAlarm> getNetEquCurrentAlarm() {
//       return netEquCurrentAlarm;
//   }
//   public void setNetEquCurrentAlarm(Set<NetEquCurrentAlarm> netEquCurrentAlarm) {
//       this.netEquCurrentAlarm = netEquCurrentAlarm;
//   }
//   @OneToMany(mappedBy = "netEqu")
//   public Set<NetEquCurrentFault> getNetEquCurrentFault() {
//       return netEquCurrentFault;
//   }
//   public void setNetEquCurrentFault(Set<NetEquCurrentFault> netEquCurrentFault) {
//       this.netEquCurrentFault = netEquCurrentFault;
//   }

    @Column(name = "equState")
    public String getEquState() {
        return equState==null?"可用":equState;
    }

    public void setEquState(String equState) {
        this.equState = equState;
    }
//    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "equProblem")
//    @NotFound(action = NotFoundAction.IGNORE)
//    public Dictionary getEquProblem() {
//        return equProblem;
//    }
//
//    public void setEquProblem(Dictionary equProblem) {
//        this.equProblem = equProblem;
//    }
//
//   @ManyToOne(fetch = FetchType.LAZY)
//   @JoinColumn(name = "webSocketServiceId")
//   public E_service getWebSocketService() {
//       return webSocketService;
//   }
//
//   public void setWebSocketService(E_service webSocketService) {
//       this.webSocketService = webSocketService;
//   }




}
